package com.itheima.lambda.test8;

public class Dog {
    public void eat(){
        System.out.println("狗吃骨头...");
    }
}

class DogTest{
    public static void main(String[] args) {
        //1. 使用匿名内部类充当具体类的子类对象
        Dog d = new Dog(){
            @Override
            public void eat() {
                System.out.println("二哈吃小鱼干...");
            }
        };

        d.eat();
    }
}
